import java.util.Scanner;

/**
   A program that reads in an interest rate and creates a table of
   future values of a one-thousand dollar certificate of deposit
   for that interest rate and different numbers of years.
   All variables should be of type double, except for the number of years.
*/
public class CDTable
{
   public static void main (String[] args)
   {
      // Display prompt for interest rate
      System.out.print("Please enter the rate of interest: ");

      // Read interest rate
      Scanner in = new Scanner(System.in);
      double rate = in.nextDouble();

      int years = 0;
      double presentVal = 1000.00;
      
      System.out.printf("%2d %7.2f\n", years, presentVal);
      years = years + 5;
      // Print out different values for different years

      // Your work here
      double futureVal = presentVal;
      for (int i=1 ; i<=5 ; i++)
      {
         futureVal = futureVal * (1+rate/100);
      }
      System.out.printf("%2d %7.2f\n", years, futureVal);
      years = years + 5;
       for (int i=1 ; i<=5 ; i++)
      {
         futureVal = futureVal * (1+rate/100);
      }
      System.out.printf("%2d %7.2f\n", years, futureVal); 
      years = years + 5;
       for (int i=1 ; i<=5 ; i++)
      {
         futureVal = futureVal * (1+rate/100);
      }
      System.out.printf("%2d %7.2f\n", years, futureVal); 
      years = years + 5;
      for (int i=1 ; i<=5 ; i++)
      {
         futureVal = futureVal * (1+rate/100);
      }
      System.out.printf("%2d %7.2f\n", years, futureVal); 
       years = years + 5;
      for (int i=1 ; i<=5 ; i++)
      {
         futureVal = futureVal * (1+rate/100);
      }
      System.out.printf("%2d %7.2f\n", years, futureVal); 
      years = years + 5;

   }
}